import { NavLink, useLocation } from 'react-router-dom';
import "./index.scss";

const MyFooter = (props) => {
    const { pathname } = useLocation();
    const arr = ['/', '/category', '/ceo', '/cart', '/me'];
    return <>
        {
            arr.indexOf(pathname) !== -1 ? <div className='footer'>
                <NavLink to="/" exact='true'>
                    <div className="footer-img"></div>
                    <div className='footer-text'>首页</div>
                </NavLink>
                <NavLink to="/category" >
                    <div className="footer-img"></div>
                    <div className='footer-text'>分类</div>
                </NavLink>
                <NavLink to="/ceo" >
                    <div className="footer-img"></div>
                    <div className='footer-text'>会员</div>
                </NavLink>
                <NavLink to="/cart" >
                    <div className="footer-img"></div>
                    <div className='footer-text'>购物车</div>
                </NavLink>
                <NavLink to="/me" >
                    <div className="footer-img"></div>
                    <div className='footer-text'>我的</div>
                </NavLink>
            </div> : ""
        }

    </>
}

export default MyFooter;